﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:classes="clr-namespace:Automator.Classes"
                    xmlns:core="clr-namespace:Automator.Tasks.Core;assembly=Automator.Tasks.Core">

    <classes:CommandLineConverter x:Key="CommandLineConverter" />
    <classes:LogImageConverter x:Key="LogImageConverter" />
    <classes:LogDateTimeConverter x:Key="LogDateTimeConverter" />
    <classes:TaskStateImageConverter x:Key="TaskStateImageConverter" />
    <classes:TooltipConverter x:Key="TooltipConverter" />
    <classes:WorkflowImageConverter x:Key="WorkflowImageConverter" />

    <Style TargetType="{x:Type Image}" x:Key="ToolbarImageStyle">
        <Style.Triggers>
            <DataTrigger
                Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=IsEnabled}"
                Value="False">
                <Setter Property="Opacity" Value="0.5" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <DrawingImage x:Key="overlayRun">
        <DrawingImage.Drawing>
            <ImageDrawing
                Rect="0 0 16 16"
                ImageSource="/Automator;component/Resources/run.png" />
        </DrawingImage.Drawing>
    </DrawingImage>

    <DataTemplate x:Key="clipboardTaskTemplate" DataType="{x:Type core:Task}">
        <StackPanel Orientation="Horizontal" Margin="6,0,4,0" MinWidth="200">
            <Image Width="32" Height="32" Source="{Binding TaskImage}" Margin="4" />
            <StackPanel Orientation="Vertical">
                <TextBlock 
                    FontWeight="Bold"
                    Text="{Binding Path=Title}"
                    Margin="0,4,0,0"
                    FontSize="12"
                    x:Name="lblTitle" />
                <TextBlock
                    FontWeight="Light"
                    Text="{Binding Path=CommandText, Converter={StaticResource CommandLineConverter}}"
                    Foreground="{x:Static SystemColors.GrayTextBrush}"
                    FontSize="12"
                    x:Name="lblCommand" />
            </StackPanel>
        </StackPanel>
    </DataTemplate>

</ResourceDictionary>